<template>
    <div>
        <footer>
            <div v-for="(item,index) in footerList" :class="{active:'/'+item.path==i}" :key="index"
                @click="cut(item.path)">
                <span :class="`iconfont ${item.icon} `"></span>
                {{item.name}}
            </div>
        </footer>
    </div>
</template>

<script>
export default {
    props: {
        footerList: {
            type: Array
        },
    },
    data() {
        return {
            i: this.$route.path
        }
    },
    methods: {
        cut(path) {
            this.i = '/' + path
            if (this.$route.path == '/' + path) {
            } else {
                this.$router.push(path)
            }

        }
    }
}
</script>

<style lang="scss" scoped>
footer {
    position: fixed;
    left: 0;
    bottom: 0rem;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background-color: #fff;
    overflow: hidden;

    >div {
        padding: .15rem;
        flex: 1;
        text-align: center;
        font-size: .30rem;
        box-sizing: border-box;
    }

    >div>span {
        font-size: .5rem;
        display: block;
    }

    .active {
        color: #fe7a03;
    }

}
</style>